//Sat May 28 11:07:51 CDT 2011
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

class CubeStickers {
public:
	string isPossible(vector<string> sticker) {
		set<string> s(sticker.begin(), sticker.end());
		colors = vector<string> (s.begin(), s.end());
		if (s.size() < 3)
			return "NO";
		for (int i = 0; i < sticker.size(); i++) {
			mp[sticker[i]]++;
		}
		int faces = 6;
		for (int i = 0; i < colors.size(); i++) {
			if (mp[colors[i]] >= 2)
				faces -= 2;
			else
				faces--;
		}
		return faces > 0 ? "NO" : "YES";
	}
	map<string, int> mp;
	vector<string> colors;
};

